import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:get/get.dart';
import 'package:get/get_navigation/src/root/get_material_app.dart';
import 'package:get_storage/get_storage.dart';
import 'package:jxchmz/%E5%9B%BD%E9%99%85%E5%8C%96%E8%AF%AD%E8%A8%80%E5%8C%85/LangPackage.dart';
import 'package:jxchmz/%E7%99%BB%E5%BD%95/Login.dart';

 main() async {
  await GetStorage.init;
  runApp(RootApp());
  if (Platform.isAndroid) {
    //设置Android头部的导航栏透明
    SystemUiOverlayStyle systemUiOverlayStyle = SystemUiOverlayStyle(
        statusBarColor: Colors.transparent, //全局设置透明
        statusBarIconBrightness: Brightness.light
      //light:白色图标 dark：黑色图标
      //在此处设置statusBarIconBrightness为全局设置
    );
    SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
  }
}
class RootApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    //使用 GetX第一步
    return GetMaterialApp(
      debugShowCheckedModeBanner: false,
      //跟随手机系统语言
      locale: Get.deviceLocale,
        translations: LangPackage(),
        fallbackLocale: Locale("zh","CN"),
        localizationsDelegates: const [   // localizationsDelegates delegate 必须得设置
          GlobalMaterialLocalizations.delegate,
          GlobalWidgetsLocalizations.delegate,
        ],
      //默认显示的首页页面
      home: Login(),
    );
  }
}

